(function (lib, config) {
    var loadFunc = function () {
        var textAry = config.words.split('|'), bgcolorAry = config.bgcolor.split('|'), textcolorAry = config.textcolor.split('|'), imglinkAry = config.imglink.split('|'), weblinkAry = config.weblink.split('|'), identifier = config.identifier.split('|');
        identifier[0] = identifier[0] || 'swt_quanping';
        textAry[0] = textAry[0] || '0451-84832055';
        textAry[1] = textAry[1] || '北大专家亲诊单位';
        textAry[2] = textAry[2] || '市医保定点医院';
        textAry[3] = textAry[3] || '市医保定点医院';
        textAry[4] = textAry[4] || '特聘北大教授亲诊';
        textAry[5] = textAry[5] || '副高职称专家坐诊';
        textAry[6] = textAry[6] || '男科主任医师10人';
        textAry[7] = textAry[7] || '临床经验20年以上';
        textAry[8] = textAry[8] || '根据您的搜索，推荐专家为您解答';
        textAry[9] = textAry[9] || '您好，您想了解';
        textAry[10] = textAry[10] || '方面的问题吗？';
        textAry[11] = textAry[11] || '我们有多年的在线问诊经验，能根据您的症状给您专业的解答！';
        textAry[12] = textAry[12] || '哈尔滨九龙医院';
        imglinkAry[0] = imglinkAry[0] || 'http://m.hebjlnk.com/swt/20180309qdswt/img/swt_logo.png';
        imglinkAry[1] = imglinkAry[1] || 'http://m.hebjlnk.com/swt/20180309qdswt/img/swt_banner.jpg';
        imglinkAry[2] = imglinkAry[2] || 'http://m.hebjlnk.com/swt/20180309qdswt/img/swt_img.jpg';
        imglinkAry[3] = imglinkAry[3] || 'http://m.hebjlnk.com/swt/20180309qdswt/img/swt_t1.png';
        imglinkAry[4] = imglinkAry[4] || 'http://m.hebjlnk.com/swt/20180309qdswt/img/swt_t2.png';
        imglinkAry[5] = imglinkAry[5] || 'http://m.hebjlnk.com/swt/20180309qdswt/img/swt_t3.png';
        imglinkAry[6] = imglinkAry[6] || 'http://m.hebjlnk.com/swt/20180309qdswt/img/swt_t4.png';
        imglinkAry[7] = imglinkAry[7] || 'http://m.hebjlnk.com/swt/20180309qdswt/img/swt_dh.png';
        imglinkAry[8] = imglinkAry[8] || 'http://m.hebjlnk.com/swt/20180309qdswt/img/swt_dhk.jpg';
        bgcolorAry[0] = bgcolorAry[0] || '#12a04f';
        bgcolorAry[1] = bgcolorAry[1] || '#27aa5f';
        bgcolorAry[2] = bgcolorAry[2] || '#27ae61';
        bgcolorAry[3] = bgcolorAry[3] || '#f8f8f8';
        bgcolorAry[4] = bgcolorAry[4] || '#f4fef8';
        textcolorAry[0] = textcolorAry[0] || '#059039';
        textcolorAry[1] = textcolorAry[1] || '#3c3c3c';
        textcolorAry[2] = textcolorAry[2] || '#fff';
        textcolorAry[3] = textcolorAry[3] || '#3c3c3c';
        textcolorAry[4] = textcolorAry[4] || '#cc3333';
        textcolorAry[5] = textcolorAry[5] || '#fff';
        textcolorAry[6] = textcolorAry[6] || '#a2a2a2';
        textcolorAry[7] = textcolorAry[7] || '#fff';
        textcolorAry[8] = textcolorAry[8] || '#a2a2a2';
        textcolorAry[9] = textcolorAry[9] || '#000';
        textcolorAry[10] = textcolorAry[10] || '#000';
        textcolorAry[11] = textcolorAry[11] || '#000';
        textcolorAry[12] = textcolorAry[12] || '#000';
        /*TODO 方法*/
        var strVar = [];
        strVar.push("<div class=\'new_swt_tan\'><div class=\'new_swt_header\'><ul><li><a href=\"tel:" + textAry[0] + "\"><img src=\'http://m.hebjlnk.com/swt/20180309qdswt/img/swt_tel.png\'/></a></li><li><a onclick=\"openZoosUrl(\'" + identifier[0] + "\')\" href=\"javascript:void(0);\"><img src=\'" + imglinkAry[0] + "\'/></a></li><li><a onclick=\'newtan_an()\'><span>关闭</span><em>></em></a></li></ul></div><div class=\'new_swt_box\'><a onclick=\"openZoosUrl(\'" + identifier[0] + "\')\" href=\"javascript:void(0);\"><img src=\'" + imglinkAry[1] + "\'/></a></div><div class=\'swt_boox new_swt_box2\'><dl><dt><img src=\'" + imglinkAry[2] + "\'/></dt><dd><h3 style='color:"+textcolorAry[12]+";'>" + textAry[12] + "<font>荐</font></h3><p style='color:"+textcolorAry[1]+";'>" + textAry[1] + "</p><p style='color:"+textcolorAry[2]+";'>" + textAry[2] + "</p><span style='color:"+textcolorAry[3]+";'>" + textAry[3] + "</span></dd></dl><ul><li><img src=\'" + imglinkAry[3] + "\'/><p style='color:"+textcolorAry[4]+";'>" + textAry[4] + "</p></li><li><img src=\'" + imglinkAry[4] + "\'/><p style='color:"+textcolorAry[5]+";'>" + textAry[5] + "</p></li><li><img src=\'" + imglinkAry[5] + "\'/><p style='color:"+textcolorAry[6]+";'>" + textAry[6] + "</p></li><li><img src=\'" + imglinkAry[6] + "\'/><p style='color:"+textcolorAry[7]+";'>" + textAry[7] + "</p></li></ul></div><p class=\'new_swt_tx\'>" + textAry[8] + "</p><div class=\'swt_boox swt_zjdh\'><ul><li><a onclick=\"openZoosUrl(\'" + identifier[0] + "\')\" href=\"javascript:void(0);\"><div><p><img src=\'" + imglinkAry[7] + "\'/></p><p style='"+textcolorAry[9]+"'><img src=\'" + imglinkAry[8] + "\'/>" + textAry[9] + "<span></span><span style='color:"+textcolorAry[10]+";'>" + textAry[10] + "</span></p></div></a></li><li><a onclick=\"openZoosUrl(\'" + identifier[0] + "\')\" href=\"javascript:void(0);\"><div><p><img src=\'" + imglinkAry[7] + "\'/></p><p style='color:"+textcolorAry[11]+";'><img src=\'" + imglinkAry[8] + "\'/>" + textAry[11] + "</p></div></a></li></ul></div><div class=\'swt_piaofu\'><ul><li><a onclick=\"openZoosUrl(\'" + identifier[0] + "\')\" href=\"javascript:void(0);\"><img src=\'http://m.hebjlnk.com/swt/20180309qdswt/img/xl.png\'/></a></li><li><a onclick=\"openZoosUrl(\'" + identifier[0] + "\')\" href=\"javascript:void(0);\"><input type=\'text\'id=\'jieda\'value=\'\'/></a></li><li><a onclick=\"openZoosUrl(\'" + identifier[0] + "\')\" href=\"javascript:void(0);\">+</a></li><li id=\'hz-tijiao\'><a onclick=\"openZoosUrl(\'" + identifier[0] + "\')\" href=\"javascript:void(0);\">发送</a></li></ul></div></div>");

        strVar.push("<style>.new_swt_tan::-webkit-scrollbar{width:0px;height:0px;}.new_swt_tan span,.new_swt_tan h1,.new_swt_tan h2,.new_swt_tan h3,.new_swt_tan h4,.new_swt_tan h5,.new_swt_tan h6,.new_swt_tan p,.new_swt_tan a,.new_swt_tan em,.new_swt_tan font,.new_swt_tan img,.new_swt_tan b,.new_swt_tan i,.new_swt_tan dl,.new_swt_tan dt,.new_swt_tan dd,.new_swt_tan ol,.new_swt_tan ul,.new_swt_tan li,.new_swt_tan form{line-height:normal;font-family:Microsoft YaHei,sans-serif,Arial,Helvetica;float:initial;margin:0;padding:0;border:0;outline:0;vertical-align:baseline;background:transparent;}.new_swt_tan ul,.new_swt_tan ol.new_swt_tan,li{list-style:none !important;}.new_swt_tan em{font-style:normal;}.new_swt_tan a{font-family:Microsoft YaHei,sans-serif,Arial,Helvetica;text-decoration:none;cursor:pointer;cursor:hand;color:" + '#3c3c3c' + ";}.new_swt_tan input{font-family:Microsoft YaHei,sans-serif,Arial,Helvetica;border:0;outline:0;}.new_swt_tan input.dialog{width:0;height:0;font-size:0;line-height:0;border:0}.new_swt_tan input[type=\'submit\'],.new_swt_tan input[type=\'reset\'],.new_swt_tan input[type=\'button\'],button{-webkit-appearance:none;border-radius:0;}.new_swt_tan{width:100%;height:100%;line-height:normal;font-family:Microsoft YaHei,sans-serif,Arial,Helvetica;z-index:9999999999;display:none;color:#3c3c3c;top:0;bottom:0;right:0;left:0;background:#fff;max-width:640px;min-width:320px;margin:auto;overflow:auto;clear:both;font-size:1em;position:fixed;}.new_swt_tan img{display: inline-block;width:100%;max-width:100%;vertical-align:top;border:0;outline:0;height:auto !important;}.swt_boox:after,.clearfix:after{visibility:hidden;display:block;font-size:0;content:\'\';clear:both;height:0;}.swt_boox,.clearfix{zoom:1;}.swt_boox{width:93.75%;margin:auto;overflow:hidden;padding:0 3.125%;}.new_swt_header ul{background:" + bgcolorAry[0] + ";height:2.5em;display:-webkit-box;-webkit-box-pack:justify;-webkit-box-align:center;padding:0 4%;color:#FFFFFF;max-width:640px;min-width:320px;box-sizing:border-box;margin:auto;}.new_swt_header ul li:last-child{width:12%;position:relative;padding-bottom:1%;}.new_swt_header ul li:last-child a{display:-webkit-box;-webkit-box-pack:justify;-webkit-box-align:baseline;color:" + '#fff' + ";}.new_swt_header ul li:last-child em{font-family:Microsoft YaHei,sans-serif,Arial,Helvetica;font-size:1.2em;display:block;color:#fff;}.new_swt_header ul li:last-child span{font-family:Microsoft YaHei,sans-serif,Arial,Helvetica;font-size:1em;display:block;}.new_swt_header ul li:nth-child(2){width:42.2%;}.new_swt_header ul li:first-child{width:6.5%;}.new_swt_header ol{padding:3%;border-bottom:1px #d7d7d7 solid;display:-webkit-box;-webkit-box-pack:justify;-webkit-box-align:center;}.new_swt_header ol li{width:18%;border:1px #24a65c solid;text-align:center;line-height:2em;color:#24a65c;font-weight:bold;}.swt_zjdh{margin:0 auto 2.8em auto;}.swt_zjdh li{padding-bottom:1.5%;display:none;}.swt_zjdh ul li div{display:-webkit-box;-webkit-box-pack:justify;-webkit-box-align:center;}.swt_zjdh ul li p:first-child{width:13.5%;}.swt_zjdh ul li p:nth-child(2){width:79%;background:" + bgcolorAry[4] + ";border:1px #a9ecc3 solid;padding:2%;box-sizing:border-box;position:relative;border-radius:.3em;height:auto;}.swt_zjdh ul li p:nth-child(2) span{color:" + '#cc3333' + ";font-weight:bold;}.swt_zjdh ul li p:nth-child(2) img{width:4%;left:-4%;top:20%;position:absolute;}.swt_piaofu{max-width:640px;min-width:320px;margin:auto;left:0;right:0;bottom:0;line-height:2.25em;padding:1% .8em;background:#ffffff;position:fixed;border-top:1px #e4e4e4 dashed;box-sizing:border-box;}.swt_piaofu ul{display:-webkit-box;-webkit-box-pack:justify;-webkit-box-align:center;color:#FFFFFF;}.swt_piaofu ul li:nth-child(1){width:7.1%;}.swt_piaofu ul li:nth-child(2){width:60%;background:#f3f3f3;border-radius:.3em;box-sizing:border-box;}.swt_piaofu ul li input{line-height:2em;font-size:.9em;color:#999999;width:100%;background:#f3f3f3;padding:0 1% 0 3%;box-sizing:border-box;}.swt_piaofu ul li a{display:block;}.swt_piaofu ul li:nth-child(3){width:1.625em;border-radius:50%;border:1px #b5b5b5 solid;text-align:center;height:1.625em;color:#b5b5b5;}.swt_piaofu ul li:nth-child(3) a{line-height:1;color:#b5b5b5;font-size:1.4em;}.swt_piaofu ul li:nth-child(4) a{color:" + '#fff' + ";line-height: 2.25em;}.swt_piaofu ul li:nth-child(4){width:14.5%;background:" + bgcolorAry[2] + ";border-radius:.3em;text-align:center;}.new_swt_box2 dl{width:85%;margin:5% auto;display:-webkit-box;-webkit-box-pack:justify;-webkit-box-align:center;}.new_swt_box2 dl dt{width:32.7%;}.new_swt_box2 dl dd{width:61.7%;font-size:.85em;color: " + '#3c3c3c' + ";}.new_swt_box2 dl dd h3{font-family:Microsoft YaHei,sans-serif,Arial,Helvetica;color:" + '#059039' + ";font-size:1.166em;margin-bottom:2%;position:relative;display:inline-block;}.new_swt_box2 dl dd h3 font{font-size:.86em;font-family:Microsoft YaHei,sans-serif,Arial,Helvetica;color:#fff;background:#f85904;width:1.33em;height:1.33em;position:absolute;right:-30%;top:9%;font-weight:normal;line-height:1.33em;text-align:center;border-radius: .2em;}.new_swt_box2 dl dd p{position:relative;padding-left:.6em;font-family:Microsoft YaHei,sans-serif,Arial,Helvetica;}.new_swt_box2 dl dd p:after{content:\'\';width:.2em;height:.2em;border-radius:50%;position:absolute;left:0;top:50%;margin-top:-.15em;background:#535353;}.new_swt_box2 dl dd span{margin-top:1%;display:block;line-height:1.2;}.new_swt_box2 ul{display:-webkit-box;-webkit-box-pack:justify;-webkit-box-align:center;width:100%;margin:0 auto;}.new_swt_box2 ul li{padding:1% 2%;width:23.33%;background:" + bgcolorAry[1] + ";color:#fff;box-sizing:border-box;text-align:center;}.new_swt_box2 ul li img{width:60%;}.new_swt_box2 ul li p{margin-top:-15%;font-size:.85em;line-height:1.2;position:relative;background:" + bgcolorAry[1] + ";color: " + '#fff' + ";}.new_swt_tx{width:70%;line-height:2.08em !important;background:" + bgcolorAry[3] + " !important;color:" +textcolorAry[8] + ";border-radius:.5em;margin:2% auto 0 auto !important;font-size:.916em;text-align:center;}@media only screen and (min-width:640px){.new_swt_tan{font-size:24px;}}@media only screen and (min-width:540px)and (max-width:639px){.new_swt_tan{font-size:17px;}}@media only screen and (min-width:414px)and (max-width:539px){.new_swt_tan{font-size:15px;}}@media only screen and (min-width:375px)and (max-width:413px){.new_swt_tan{font-size:15px;}}@media only screen and (min-width:342px)and (max-width:374px){.new_swt_tan{font-size:13px;}}@media only screen and (min-width:320px)and (max-width:341px){.new_swt_tan{font-size:13px;}}</style>");
        var o = document.createElement('div');
        o.innerHTML = strVar.join('');
        while (o.firstElementChild) {
            document.body.appendChild(o.firstElementChild);
        };

        setTimeout(new_swt_tan_show, config.firsttime * 1000);
        var swt_shuru = document.querySelector('.swt_piaofu ul li input');
        var swt_piaofu = document.querySelector('.swt_piaofu');
        var new_swt_tan = document.querySelector('.new_swt_tan');
        var swt_zjdh = document.querySelectorAll('.swt_zjdh li');
        var swt_NewsTime = 300;    //每条信息完整出现后停留时间
        var swt_TextTime = 300;    //每条信息中的字出现的间隔时间
        var swt_newsi = 0;
        var swt_txti = 0;
        var swt_txttimer;   //调用setInterval的返回值，用于取消对函数的周期性执行
        var swt_newstimer;
        var swt_hwnewstr = '请在此输入....';
        swt_shownew = function () {
            if (swt_txti >= swt_hwnewstr.length) {
                clearInterval(swt_txttimer);  //一旦超过要显示的文字长度，清除对swt_shownew()的周期性调用
                clearInterval(swt_newstimer);
                swt_newsi++;   //显示数组中的下一个
                if (swt_newsi >= swt_hwnewstr.length) {
                    swt_newsi = 0;  //当swt_newsi大于信息标题的数量时，把swt_newsi清零，重新从第一个显示
                }
                swt_newstimer = setInterval("swt_shownew()", swt_NewsTime);   //间隔2000ms后重新调用swt_shownew()
                swt_txti = 0;
                return;
            }
            clearInterval(swt_txttimer);
            swt_shuru.value = swt_hwnewstr.substring(0, swt_txti + 1);   //截取字符，从第一个字符到swt_txti+1个字符
            swt_txti++;  //文字一个个出现
            swt_txttimer = setInterval("swt_shownew()", swt_TextTime);
        }
        swt_shownew();
        //获取关键词
        var swt_fu_p = document.querySelector('.swt_zjdh ul li p:nth-child(2) span');
        var refer = document.referrer;
        var sosuo = refer.split(".")[1];
        var grep = null;
        var str = null;
        var keys = null;
        var keyword = null;
        try {
            switch (sosuo) {
                case "baidu":
                    if (refer.indexOf("word=") > -1) {
                        grep = /word\=.*\&/i;
                    } else {
                        grep = /wd\=.*\&/i;
                    }
                    str = refer.match(grep)
                    keyword = str.toString().split("=")[1].split("&")[0];
                    keys = decodeURIComponent(keyword);
                    break;
                case "sogou":
                    if (refer.indexOf("keyword=") > -1) {
                        grep = /keyword\=.*\&/i;
                    } else {
                        grep = /query\=.*\&/i;
                    }
                    str = refer.match(grep)
                    keyword = str.toString().split("=")[1].split("&")[0];
                    keys = decodeURIComponent(keyword);
                    break;
                case "m":
                    if (refer.indexOf("q=") > -1) {
                        grep = /q\=.*\&/i;
                    }
                    str = refer.match(grep)
                    keyword = str.toString().split("=")[1].split("&")[0];
                    keys = decodeURIComponent(keyword);
                    break;
                case "sm":
                    if (refer.indexOf("q=") > -1) {
                        grep = /q\=.*\&/i;
                    }
                    str = refer.match(grep)
                    keyword = str.toString().split("=")[1].split("&")[0];
                    keys = decodeURIComponent(keyword);
                    break;
                default:
                    keys = "男科";
            }
        } catch (e) {
            keys = "男科";
        }
        swt_fu_p.innerHTML = keys;
        function new_swt_tan_show() {
            new_swt_tan.style.display = 'block';
            setTimeout(function () {
                swt_zjdh[0].style.display = 'block';
                setTimeout(function () {
                    swt_zjdh[1].style.display = 'block';
                }, 1500)
            }, 2000)
        }
        newtan_an = function () {
            new_swt_tan.style.display = 'none';
            swt_zjdh[0].style.display = 'none';
            swt_zjdh[1].style.display = 'none';
            setTimeout(new_swt_tan_show, config.relapsetime * 1000)
        }
        var az_app = document.querySelector('.swt_piaofu ul li:nth-child(3) a');
        var u = navigator.userAgent;
        var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端
        if (isAndroid) { az_app.style.lineHeight = 1.3; }
    };
    lib.load(loadFunc);/*执行代码*/
})('{{lib}}', '{{config}}');